﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Vista.Controls
{
    public partial class ModalPanel : System.Web.UI.UserControl
    {
        public string LabelHeader
        {
            set { lblHeader.Text = value; }
        }

        public string LabelBody
        {
            set { lblBody.Text = value; }
        }

        public string TextBody
        {
            get { return textBody.Text; }
            set { textBody.Text = value; }
        }

        public bool MostraInfo
        {
            set
            {
                lblBody.Visible = value;
                btnAcceptar.Visible = value;
                btnCancelar.Visible = !value;
            }
        }

        public bool EsperaResposta
        {
            set
            {
                btnAcceptar.Visible = value;
                btnCancelar.Visible = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void MostrarModal()
        {
            mdeModalMostraMissatge.Show();

            if (lblBody.Text.Equals(ConstantsAlbara.mplbEditarAlbaraNoTrobat))
                Response.Redirect(Request.ApplicationPath + ConstantsGlobals.URLBuscarAlbara);
            
        }

        protected void btnAcceptar_Click(object sender, EventArgs e)
        {
            mdeModalMostraMissatge.Hide();
        }

        protected void btnCancelar_Click(object sender, EventArgs e)
        {
            mdeModalMostraMissatge.Hide();
        }

    }
}